<div class="col-md-4 col-sm-4 pull-right">	
	<div class="panel panel-primary">
		<div class="panel-heading">
		  <h3 class="panel-title">Tìm kiếm</h3>
		</div>
		<div class="panel-body" style="overflow: visible;">
			<form role="form" action="<?=site_url('dau-bep/tim-kiem')?>" method="post">
				<?php 
					$sterm = array(
						'key'				=>	'',
						'chieu_cao_m' 	=>	1,
						'gioi_tinh' 	=> 0,
						'tinh_thanh' 	=> 0,
						'quan_huyen'	=>	'',
						// 'chieu_cao_cm_min' => 00,
						// 'chieu_cao_cm_max' => 99,
						'tgian_tu'		=>	'',
						'tgian_den'		=>	'',
						'dich_vu' => array()
					);
					
					$cached = $this->session->userdata('sterm');
					// echo '<pre>';print_r($cached);die;
					if(!$cached) $cached = array();
					$sterm = array_merge($sterm, $cached);
				?>
				<div class="form-group">
					<label for="key">Từ khóa</label>
					<?php echo form_input('key', $sterm['key'],'class="form-control" id="key"');?>
				</div>
				<table width="100%">
					<tbody>
						<tr>
							<td class="table-control" width="50%">
								<label for="key">Giới tính</label>
								<?php $gioi_tinh = array('0'=>'Nữ','1'=>'Nam');?>
								<?php echo form_dropdown('gioi_tinh', $gioi_tinh, $sterm['gioi_tinh'], 'class="form-control" id="gioi_tinh"')?>
							</td>							
							<td class="table-control" >
							<?/*	<label for="key">Chiều cao</label>
								<?php $chieu_cao 	= array(
										'0-199'		=>'Chiều cao',
										'0-155'		=>'Duới 1m55',
										'155-160'	=>'1m55 đến 1m60',
										'160-165'	=>'1m60 đến 1m65',
										'165-170'	=>'1m65 đến 1m70',
										'170-199'	=>'Trên 1m70',
									);
									$min = $sterm['chieu_cao_cm_min'] == 0?0:$sterm['chieu_cao_m']*(100+$sterm['chieu_cao_cm_min']);
									$key = $min.'-'.$sterm['chieu_cao_m']*(100+$sterm['chieu_cao_cm_max']);
								?>
								<?php echo form_dropdown('chieu_cao', $chieu_cao, $key,'class="form-control" id="chieu_cao"')?>
							*/?>
							</td>
						</tr>
						<tr>
							<td class="table-control" >
								<label for="key">Tỉnh thành</label>
								<?php $tinh_thanh = $this->session->userdata('tinh_thanh');
									if(!$tinh_thanh) $tinh_thanh = array();
										$tinh_thanh = array(0 => 'Tất cả') + $tinh_thanh;
								?>
								<?php echo form_dropdown('tinh_thanh',$tinh_thanh,$sterm['tinh_thanh'],'class="form-control" id="tinh_thanh" onchange="get_quan_huyen(this);"');?>
							</td>
							<td class="table-control" >
								<label for="key">Quận/huyện</label>
								<?php 
									$quan_huyen = $this->register->get_quan_huyen($sterm['tinh_thanh'], true);
									$quan_huyen = array(0 => 'Tất cả') + $quan_huyen;
								?>
								<div id="quan_huyen_wrap">
								<?php echo form_dropdown('quan_huyen',$quan_huyen,$sterm['quan_huyen'],'class="form-control" id="quan_huyen"');?>
								</div>
							</td>
						</tr>						
						<tr>
							<td class="table-control" colspan="2">
								<label for="key">Sở trường</label>
								<?php $dich_vu = $this->session->userdata('dich_vu');
									if(!$dich_vu) $dich_vu = array();
								?>
								<?php echo form_multiselect('dichvu[]',$dich_vu,$sterm['dich_vu'],'class="multiselect" id="dichvu"');?>
							</td>
						</tr>
						<tr>
							<td class="table-control datepairExample">
								<label for="key">Thời gian từ</label>
								<?php $tgian_tu = array('id'=>'tgian_tu', 'class'=>'form-control time start', 'name'=>'tgian_tu', 'value'=> $sterm['tgian_tu'],'style'=>'');
								echo form_input($tgian_tu);?>
							</td>
							<td class="table-control datepairExample">
								<label for="key">đến</label>
								<?php $tgian_den = array('id'=>'tgian_den', 'class'=>'form-control time end', 'name'=>'tgian_den', 'value'=> $sterm['tgian_den'],'style'=>'');
									echo form_input($tgian_den);
								?>
								<script type="text/javascript" src="<?=base_url('assets/js/jquery.timepicker.js')?>"></script>
								<script type="text/javascript" src="<?=base_url('assets/js/datepair.js')?>"></script>
								<script type="text/javascript" src="<?=base_url('assets/js/jquery.datepair.js')?>"></script>
								<link rel="stylesheet" type="text/css" href="<?=base_url('assets/css/jquery.timepicker.css')?>"/>
								<script>
									jQuery('.datepairExample .time').timepicker({
									  'showDuration': true,
									  'timeFormat': 'H:i'				  
									});
									jQuery('.datepairExample').datepair();
								</script>
							</td>
						</tr>
						<tr>
							<td style="text-align:center" colspan="2">
								<p>&nbsp;</p>
								<input type="submit" class="btn btn-default" value="Tìm kiếm"/>
							</td>
						</tr>
					</tbody>
				</table>				
			</form>
		</div>
	</div>
	<div class="panel panel-primary">
		<div class="panel-heading">
		  <h3 class="panel-title">Facebook</h3>
		</div>
		<div class="panel-body">
		  <div class="fb-like-box" data-href="https://www.facebook.com/pgvietnampro" data-width="308" data-height="300" data-colorscheme="light" data-show-faces="true" data-header="false" data-stream="false" data-show-border="false"></div>
		</div>
	</div>
	<?php $this->load->view('tpl/help');?>
	<?php global $statistic_users;
		if($statistic_users):
	?>	
	<div class="panel panel-primary">
		<div class="panel-heading">
		  <h3 class="panel-title">Thống kê</h3>
		</div>
		<div class="panel-body">
			
		  <ul class="statistics">
				<li>
					<a title="">Online Users: <span class="online"><?=$statistic_users->online?></span></a>
				</li>
				<li>
					<a title="">Today Visit: <span class="today"><?=$statistic_users->today?></span></a>
				</li>
				<li>
					<a title="">This Month: <span class="today"><?=$statistic_users->month?></span></a>
				</li>
				<li>
					<a title="">Total Visit: <span class="total"><?=$statistic_users->total?></span></a>
				</li>
			</ul>
		</div>
	</div>
	<?php endif;?>
	<?/*
	<div class="panel panel-primary">
		<div class="panel-heading">
		  <h3 class="panel-title">Quảng cáo</h3>
		</div>
		<div class="panel-body">		
			<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
			<!-- pgvietnamworks308x180 -->
			<ins class="adsbygoogle"
				  style="display:inline-block;width:308px;height:180px"
				  data-ad-client="ca-pub-7992234073591084"
				  data-ad-slot="3180006856"></ins>
			<script>
			(adsbygoogle = window.adsbygoogle || []).push({});
			</script>
		</div>
	</div>*/?>
	<div class="panel panel-primary">
		<div class="panel-heading">
		  <h3 class="panel-title">Liên hệ quảng cáo</h3>
		</div>
		<div class="panel-body">		
			<div style="text-align:center;font-size:18;color:red">
				<p>Kích thước: Rộng: 308px, Cao:180px</p>
				<p>Miễn phí đến 31/12/2014</p>
				<p>Email: pgvietnamworks@gmail.com</p>				
			</div>
		</div>
	</div>
</div>